package com.library.dao.impl;

import com.library.bean.User;
import com.library.dao.BaseDao;
import com.library.dao.UserDao;

/**
 * @Author:qjc
 * @Date: 2024/9/14 20:20
 * @Description:
 */
public class UserDaoImpl implements UserDao {

    @Override
    public int userReg(User user) {
        String sql="INSERT INTO user (userName,userPass,realName) value(?,?,?)";
        Object[] obj={user.getUserName(),user.getPassword(),user.getRealName()};
        int num= BaseDao.executeUpdate(sql,obj);
        return num;
    }

    @Override
    public User userLoad(User user) {
    User u=BaseDao.query(user.getUserName(),user.getPassword());
    return u;
    }
}
